import axios from 'axios';
import { api } from '@/utils/global';

const service = axios.create({
  baseURL: api.baseURL,
  timeout: api.timeout
});

// 请求拦截
service.interceptors.request.use(config => {
  return config;
}, error => {
  return Promise.reject(error);
});

// 响应拦截
service.interceptors.response.use(res => {
  return Promise.resolve(res);
});

export default service;